<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\models\User */
$this->registerCssFile('/css/common.css');
$this->registerCssFile('/fonts/iconfont.css');
$this->registerJsFile('/js/public.js');
$this->registerCssFile('/css/safe.css');
$this->registerJsFile('/layer/layer.js');
$this->title = '安全中心-锐锋堂刀剑网';
?>
<div class="uc_right ClearFix">
	<div class="uc_location">
		<a href="http://www.happigo.com/shop/index.php?act=member&amp;op=home">用户中心</a>
		<span>&gt;</span> <a class="a_cur">账户安全</a>
	</div>
	<div class="safe_con">
		<div class="w720">    
    <?php if($_GET['flag']):?>
    <div class="flowsteps">
				<ol class="num4">
					<li
						class="first <?php if($flag):?>done<?php else:?>on<?php endif;?>">
						<div class="step_line"></div> <span><i class="i">1</i><em>验证身份</em></span>
					</li>
					<li class="<?php if($flag==2):?>done<?php elseif($flag):?>on<?php endif;?>">
						<div class="step_line"></div> <span><i class="i">2</i><em><?php if($_GET['flag']==1):?>设置登录密码<?php elseif($_GET['flag']==2):?>修改手机号码<?php endif;?></em></span>
					</li>
					<li class="last <?php if($flag==2):?>on<?php endif;?>"><span><i
							class="i">3</i><em>完成</em></span></li>
				</ol>
			</div>
			<div class="forget_item" style="display: block;">

    <?php if($flag==1):?>
    <?php $form=ActiveForm::begin()?>
    	<?php if($_GET['flag']==1):?>
        <!--设置新密码-->
        <?=$form->field($model, 'code')->hiddenInput()->label(false)?>
        <?=$form->field($model, 'password',['options'=>['class'=>'item'],'labelOptions'=>['class'=>'label_reg'],'inputOptions'=>['class'=>'i_txt']])->passwordInput(['placeholder'=>'请输入密码'])->label('密码：')?>
        <?=$form->field($model, 'rpassword',['options'=>['class'=>'item'],'labelOptions'=>['class'=>'label_reg'],'inputOptions'=>['class'=>'i_txt']])->passwordInput(['placeholder'=>'请再次输入密码'])->label('确认密码：')?>
        <div class="item">
        	<input type="button" onclick='$(form).submit()' id="btn_step1" class="btn_reg btn_step1" value="提交">
        </div>
        <?php elseif ($_GET['flag']==2):?>
        <?=$form->field($model, 'code')->hiddenInput()->label(false)?>
        <?=$form->field($model, 'tel',['options'=>['class'=>'item'],'labelOptions'=>['class'=>'label_reg'],'inputOptions'=>['class'=>'i_txt']])->textInput(['placeholder'=>'请输入手机号'])->label('新手机：')?>
        <!--手机验证码-->
    				<div class="item">
    					<span class="label_reg">验证码：</span> 
    					<?=$form->field($model, 'upcode',['options'=>['class'=>'code']])->textInput(['placeholder'=>'6位验证码','class'=>'itxt'])->label(false)?>
    					 <span class="getCode"
    						id="send_auth_code"> <input type='button' id="hide_times"
    						onclick='send(5,this)' value='获取验证码'>
    					</span>
    					<div class="err_box">
    						<span id="error_auth_code" class=""></span>
    					</div>
    				</div>
         <div class="item">
        	<input type="button" onclick='$(form).submit()' id="btn_step1" class="btn_reg btn_step1" value="提交">
        </div>
        <?php endif;?>
    <?php ActiveForm::end()?>
    <?php elseif($flag==2):?>
    <div class="suc_item">
    					<div class="suc_box">
    						<div class="edit_suc">
    							<i></i>修改成功
    						</div>
    						<a href="/user/safe.html">返回帐户安全</a>
    					</div>
    				</div>
    <?php else:?>
    <?php $form=ActiveForm::begin()?>
            <!--手机号-->
    				<div class="item">
    					<span class="label_reg">选择身份验证：</span> <span class="label_select">
    						<select name="type" id="auth_type" class="s_sfyz">
    							<option value="mobile">手机验证<?=substr_replace(Yii::$app->user->identity->tel,'****',3,4);?></option>
    					</select>
    					</span>
    				</div>
    
    				<!--手机验证码-->
    				<div class="item">
    					<span class="label_reg">请填写验证码：</span> 
    					<?=$form->field($model, 'code',['options'=>['class'=>'code']])->textInput(['placeholder'=>'6位验证码','class'=>'itxt','maxlength'=>6])->label(false)?>
    					 <span class="getCode"
    						id="send_auth_code"> <input type='button' id="hide_times"
    						onclick='send(<?php if($_GET['flag']==2):?>4<?php else:?>2<?php endif;?>,this)' value='获取验证码'>
    					</span>
    					<div class="err_box">
    						<span id="error_auth_code" class=""></span>
    					</div>
    				</div>
    				<div class="item">
    					<input type="button" onclick='$(form).submit()' id="btn_step1"
    						class="btn_reg btn_step1" value="提交">
    				</div>
            <?php ActiveForm::end()?>
            <?php endif;?>
           
        
    </div>
    <?php else:?>
        <div class="item item_login">
    				<i class="icon_noyz icon_yz"></i>
    				<div class="yz_info">
    					<h2>登录密码</h2>
    					<div class="yz_info_txt">
    						<p>互联网账号存在被盗风险，建议您定期更改密码以保护账户安全。</p>
    					</div>
    				</div>
    				<a href="?flag=1" class="btn_edit btn_yz_edit">修改</a>
    			</div>
    
    			<div class="item item_phone">
    				<i class="icon_noyz  icon_yz"></i>
    				<div class="yz_info">
    					<h2>手机验证</h2>
    					<div class="yz_info_txt">
    						<p>验证后 可用手机号快速登录，找回登录密码 同时进行积分消费的 验证确认，非常有助于保护您的账号和账户财产安全。</p>
    					</div>
    				</div>
    				<a href="?flag=2" class="btn_edit btn_yz_edit">修改</a>
    
    			</div>
    <?php endif;?>
        
<!-- 
        <div class="item item_email">
            <i class="icon_noyz " "=""></i>
            <div class="yz_info">
                <h2>邮箱验证</h2>
                <div class="yz_info_txt">
                    <p>验证后，可用于邮箱找回登录密码，找回登录密码。</p>
                </div>
            </div>
                                            <a href="" class="btn_edit">立即设置</a> 
                                
                
        </div>-->
		</div>
	</div>
</div>